package com.entrogy.service;

import com.alibaba.fastjson.JSONObject;
import com.entrogy.bean.*;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @ClassName DormService
 * @Description
 * @Author luoxingjiang
 * @Date 2019/7/9 0009 下午 2:57
 * @Version 1.0
 **/
public interface DormService {


    List<DormEntity> listDorm(Integer schoolCode, String uid, String dormName);

    boolean insertDorm(DormEntity dorm);

    boolean updateDorm(DormEntity dorm);

    boolean deleteDorm(Integer dormId);

    boolean updateStudentDormByClassId(Integer dormId, Integer classId, Integer schoolCode);

    boolean deleteStudentsFromDormId(Integer dormId, List<Integer> studentIds);

    boolean assignDevices(Map<String, Object> params);

    boolean deleteDeviceByDeviceIds(Integer dormId, List<Integer> deviceIds);

    List<LifeTeacherEntity> getListLifeTeacher(Integer schoolCode);

    boolean updateFloorLifeTeacher(String lifeTeacherId, Integer id);

    List<GradeEntity> listGradeBackTime(Integer schoolCode);

    boolean updateGradeBackTime(List<UpdateBackTimeFrameEntity> updateBackTimeFrameList);

    List<AttendanceExceptionStudentEntity> listLateStudent(Integer schoolCode, String userId, Integer gradeId, Integer dormId);

    List<AttendanceExceptionStudentEntity> lifeTeacherDormAttendance(Integer dormId, Date time);

    List<AttendanceExceptionStudentEntity> teacherDormAttendance(Integer classId, Date time);

    Date getBackTimeByLifeTeacherId(String userId, Integer gradeId);

    List<GradeEntity> listDormGradeByLifeTeacher(String uid);

    boolean addGradeBackTime(UpdateBackTimeFrameEntity backTimeFrame);

    boolean gradeIsChecked(Integer gradeId, Integer schoolCode, String checkTime, Integer dormId);

    boolean addGradeCheckedRecord(Integer gradeId, Integer schoolCode, Integer dormId, String checkGradeTime);

    boolean updateStudentFloor(Integer floorId, List<Integer> studentIdList, Integer gradeId, Integer classId, Integer schoolCode);

    boolean deleteStudentFromFloor(Integer floorId, List<Integer> studentIdList);

    List<JSONObject> listFloorStudent(Integer floorId, Integer dormId);

    Integer countFloorStudent(Integer floorId, Integer dormId);

    /**
     * 查询学校所有寝室的名称
     * @param schoolCode
     * @return
     */
    List<String> listDormName(Integer schoolCode);

    /**
     * 分配寝室大门的设备
     * @param dormDoorDevice
     * @return
     */
    boolean insertDormDoorDevice(DormDoorDeviceEntity dormDoorDevice);

    /**
     * 删除寝室大门的设备
     * @param userId
     * @param dormDoorDeviceId
     * @param deleteStatus
     * @return
     */
    boolean deleteDormDoorDevice(String userId, Integer dormDoorDeviceId, Integer deleteStatus);

    /**
     * 查找寝室大门设备
     * @param dormId
     * @param inOrOut
     * @return
     */
    List<DormDoorDeviceEntity> listDormDoorDevice(Integer dormId, String inOrOut);
}
